-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chat component #87
chat component #87
Conversation
Is fixed now :-) |
I chose to render String and Vector{String} arguments directly. @app begin
@out textmsg1 = ["hey, how are you?"]
@out textmsg2 = "I am good"
end
function ui()
[
Html.div(class="q-pa-md row justify-center",[
Html.div(style="width: 100%; max-width: 400px",[
chatmessage("This is static text", name="abhi", sent = true)
chatmessage(:textmsg1, name="abhi", sent = true)
chatmessage(Symbol("[textmsg2]"), name="adrian")
])
])
]
end |
If you are ok with this syntax, let's merge. 🚀 |
A chat app would rather apply a Vector of Dict for a chat window, e.g. like this using Random
using GenieFramework
@genietools
@app begin
@in addpost = false
@out chat = Dict{Symbol, Any}[]
@onbutton addpost begin
push!(chat, Dict(:text => [randstring(10) for i in 1:rand(1:3)], :name => randstring(5), :sent => Bool(rand(0:1))))
notify(chat)
end
end
function ui()
[
cell(class = "st-module q-ma-md q-pa-md", [
btn("Add message", @click(:addpost), icon = "mail")
chatmessage(R"d.text", name = R"d.name", sent = R"d.sent", "", @recur("d in chat"))
])
]
end
p = @page("/", ui)
Server.isrunning() || Server.up() |
@hhaensel you thought of everything. I don't have anything to add to it. I didn't think of adding |
oh and just realized all our stippleui docs is now using deprecated syntax maybe I need do entire dir look up with Regex
replace this with
that would be easiest. Adding @app begin
@out ___
@out ___
end would require manual updating however :( |
Ok no. Even the properties field have ugly R types
|
But |
|
[❌] - don't merge
Bug: don't render text message